package com.smartleanx.module.hrm.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Random;

public class GenerateOrderSn
{
    public static String getOrderSn(){
        //时间（精确到毫秒）
        DateTimeFormatter ofPattern = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
        String localDate = LocalDateTime.now().format(ofPattern);
        Random random = new Random();
        int i = random.nextInt(999999);
        localDate+=String.valueOf(i);
        return localDate;
    }

    public static void main(String[] args) {
        System.out.println(getOrderSn());
    }
}
